<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>登录校验</title>
	</head>
	<body>
		<script>
			const userName = prompt("Who's there?", '')

			// 【代码编写规范】错误前置
			if (userName == '' || userName == null) {
				alert('Canceled')
			} else if (userName != 'Admin') {
				alert("I don't know you")
			} else {
				const pass = prompt('Password?', '')

				if (pass == '' || pass == null) {
					alert('Canceled')
				} else if (pass != 'TheMaster') {
					alert('Wrong password')
				} else {
					alert('Welcome!')
				}
			}
		</script>
	</body>
</html>
